<script>
// just for the demos, avoids form submit
//jQuery.validator.setDefaults({
//  debug: true,
//  success: "valid"
//});

$().ready(function() {	
	// validate signup form on keyup and submit
	$("#CiuuserRegisterForm").validate({
		rules: {
			first_names: "required",
			last_names: "required",
			document: {
				required: true,
				number: true,
				minlength: 5
			},
			password: {
				required: true,
				minlength: 8
			},
			confirm: {
				required: true,
				minlength: 8,
				equalTo: "#password"
			},
			email: {
				required: true,
				email: true
			}
		},
		messages: {
			first_names: "*",
			last_names: "*",
			document: {
				required: "*",
				minlength: "*"
			},
			password: {
				required: "*",
				minlength: "*"
			},
			confirm: {
				required: "*",
				minlength: "*",
				equalTo: "*"
			},
			email: "*"
		}
	});

});
</script>

<div class="ciuusers form">
    <h2>Formulario de registro</h2>
    <div class="">&nbsp</div>
	<h4>
    <div class="comentario">Favor diligencia completamente este formulario de registro.</div> 	
	</h4>
	<?php
        echo $this->Form->create('Ciuuser',array('action'=>'register', 'method'=>'get'));
        echo $this->Form->input('username', array('type'=>'hidden'));
        
		echo "<table>";
		echo "<tr>";
		echo "<td>";
		echo $this->Form->input('ciuplan_id', array('options'=>$ciuplans));
		echo "</td>";
		
		echo "<td>";
		echo $this->Form->input('ciutimetable_id', array('options'=>$ciutimetables));
		echo "</td>";
		
		echo "<td>";
		echo "</td>";
		echo "<td>";
		echo "</td>";
		
		echo "</tr>";
		
		echo "<tr>";
		echo "<td>";
		echo $this->Form->input('first_names', array('required'=>''));
		echo "</td>";
		echo "<td>";
		echo $this->Form->input('last_names', array('required'=>''));
		echo "</td>";
		echo "<td>";
		echo $this->Form->input('birthday', array('required'=>'', 'type'=>'date','class'=>'selectdateshort'));
		echo "</td>";
		echo "<td>";
		echo "</td>";
		echo "</tr>";
		
		echo "<tr>";
		echo "<td>";
		echo $this->Form->input('document_type', array('options'=>array(''=>'Seleccione','CC'=>'Cedula Ciudadania', 'TI'=>'Tarjeta Identidad', 'CE'=>'Cedula Extranjeria') ) );
		echo "</td>";
		echo "<td>";
		echo $this->Form->input('document', array('required'=>'','digits'=>'','number'=>''));
		echo "</td>";
		echo "<td>";
		echo $this->Form->input('expedition_date', array('required'=>'', 'type'=>'date','class'=>'selectdateshort'));
        
		echo "</td>";
		echo "<td>";
		echo "</td>";
		echo "</tr>";
		
		
		echo "<tr>";
		echo "<td>";
		echo $this->Form->input('expedition_city', array('required'=>'', 'type'=>'text'));		
		
		echo "</td>";
		echo "<td>";
		echo $this->Form->input('password', array('required'=>'','type'=>'password', 'label'=>'Clave'));
		echo "</td>";
		echo "<td>";
		echo $this->Form->input('confirm', array('required'=>'','type'=>'password', 'label'=>'Confirme Clave'));
		echo "</td>";
		echo "<td>";
		echo $this->Form->input('address', array('required'=>''));
		
		echo "</td>";
		echo "</tr>";
		
		
		echo "<tr>";
		echo "<td>";
		echo $this->Form->input('telephone', array('required'=>''));
		echo "</td>";
		echo "<td>";
		echo $this->Form->input('email', array('required'=>''));
		echo "</td>";
		echo "<td>";
		echo $this->Form->input('academic_level', array('options'=>
		array('Ninguno'=>'Ninguno'
		, 'Primaria'=>'Primaria'
		, 'Secundaria'=>'Secundaria'
		, 'Tecnico'=>'Tecnico'
		, 'Pregrado'=>'Pregrado'
		, 'Postgrado'=>'Postgrado'
		) ) );
		echo "</td>";
		echo "<td>";
		echo $this->Form->input('occupation', array('required'=>''));
		echo "</td>";
		echo "</tr>";
		
		
		echo "<tr>";
		echo "<td>";
		
		echo $this->Form->input('occupation_description', array('required'=>''));
		echo "</td>";
		echo "<td>";
		
		echo $this->Form->input('contact_name');
		echo "</td>";
		echo "<td>";
		echo $this->Form->input('contact_telephone');
		echo "</td>";
		echo "<td>";
		echo "</td>";
		
		
		echo "</tr>";
		echo "</table>";
		
		
echo $this->Form->end( 'Register' );
?>
</div>